/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __SUN_H__
#define __SUN_H__

#include "SkyLight.h"

namespace PQEngine
{
	/*Simulate the sun using Ogre's billboards.
	*/
	class Sun
		: public SkyLight
    {
	public:
		static const Ogre::String MATERIAL_NAME;
		static const Ogre::String ENTITY_NAME;
		static const Ogre::String MESH_NAME;
		static const Ogre::String MATERIAL_CLONE_NAME;
		static const Ogre::String TEXTURE_NAME;
		static const Ogre::String BILLBOARD_NAME;
	public:
		Sun(SceneObject* sceneObject);
		void update(const Ogre::Vector3& direction,const Ogre::ColourValue &lightColor,const Ogre::ColourValue &bodyColor);
		void initMaterial();
		void initBillboards();
		void setSunTextureAngularSize(const Ogre::Degree& sunTextureAngularSize);
	private:
		Ogre::Entity* _entity;//sun entity
		Ogre::MaterialPtr _material;
		Ogre::BillboardSet* _billboards;
		Ogre::Degree _sunTextureAngularSize;/// The sun sprite visible angle
		bool _enabled;

	};
}
#endif
